package org.wlgzs.office_exam_student.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.wlgzs.office_exam_student.entity.OperateQuestion;

@WebServlet("/analysis")
public class AnalysisServlet extends BaseServlet {

	private static final long serialVersionUID = 1L;
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String key = req.getParameter("key");
		if(key!= null && key.length()>0) {
			OperateQuestion oq = operateQuestionService.operateQuestion(key);
			if(oq!=null) {
				req.setAttribute("answer", oq.getAnalysis());
				render("answer");
				return;
			}
		}
		render("404");
	}

}
